import request from "@/utils/request";
import type { CategoryList } from "./model/categoryModel";

enum Api {
  getCategory1ListUrl = "/admin/product/getCategory1",
  getCategory2ListUrl = "/admin/product/getCategory2",
  getCategory3ListUrl = "/admin/product/getCategory3",
}


export const getCategory1ListApi = () => {
  return request.get<any, CategoryList>(Api.getCategory1ListUrl);
};


export const getCategory2ListApi = (category1Id: number) => {
  return request.get<any, CategoryList>(Api.getCategory2ListUrl + `/${category1Id}`);
};

export const getCategory3ListApi = (category2Id: number) => {
  return request.get<any, CategoryList>(Api.getCategory3ListUrl + `/${category2Id}`);
};
